package com.tpyule.tpclass.service.impl;

import com.tpyule.tpclass.dao.SubscriptionDao;
import com.tpyule.tpclass.entity.pojo.Subscription;
import com.tpyule.tpclass.service.SubscriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * @author zzz
 * @version 1.0
 * @date 2020/5/8 21:11
 */
@Service
public class SubscriptionServiceImpl implements SubscriptionService {
    @Autowired
    SubscriptionDao subscriptionDao;
    @Override
    public int addSubscriptionConfig(String userId) {
        return subscriptionDao.addSubscriptionConfig(userId);
    }

    @Override
    public int addSubscription(Subscription subscription) {
        subscription.setSubscriptionId(UUID.randomUUID().toString().toUpperCase());
        return subscriptionDao.addSubscription(subscription);
    }
}
